package com.example.tool.activtiy;

import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.example.tool.R;
import com.example.tool.activtiy.base.BaseActivity;
import com.example.tool.adapter.TimeAxleAdapter2;
import com.example.tool.mvp.CommonPresent;
import com.example.tool.util.DataRequest;
import com.example.tool.util.DebugLog;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import butterknife.BindView;

/**
 * Created Date 2019/8/30
 *
 * @author liangkun
 * description：日历时间线
 */
public class TimeAxleActivity extends BaseActivity<CommonPresent> {
    @BindView(R.id.tv_title)
    protected TextView tvTitle;
    @BindView(R.id.rv_List)
    protected RecyclerView recyclerView;
    private List<HashMap<String, Object>> listItem;
    private TimeAxleAdapter2 axleAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.calender_layout_activity;
    }

    @Override
    protected void initView() {
        getData();
        tvTitle.setText("日历时间线");
        //使用线性布局
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setHasFixedSize(true);
        //为ListView绑定适配器
        DebugLog.w("TimeAxleActivity listItem " + listItem.size());
        axleAdapter = new TimeAxleAdapter2(this, listItem);
        recyclerView.setAdapter(axleAdapter);


    }

    @RequiresApi(api = Build.VERSION_CODES.N)
    @Override
    protected void initData() {
    }

    private void getData() {
        listItem = DataRequest.getAxleList();
    }


    @Override
    protected void initEvent() {

    }

    @Override
    protected CommonPresent createPresenter() {
        return null;
    }


}
